home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / d.dxr / 00014_Chime CODE.ls < prev    next >
Encoding:
Text File  |  1996-02-15  |  1.6 KB  |  45 lines

  1. global HARP, TIGO, HORN, DRUM, CHIME, BASS, sPALETTE, gObjects, gOBJECTSD, gWorld, gPuppetlines, sQTCharSprite, gNextEnvLetter, gMIDIPlayTRUE, gInitalized, noteObjs, windowsMIDIXObj, xNAVXOBJ, xCURXOBJ, gCPU, gFileSep, gRootPath, gHDpath, gXobjs, gXOBJPath, gCDpath, gCDName
  2.  
  3. on ChimeClick OBJref
  4.   set ChimeObj to getaProp(gObjects, OBJref)
  5.   set PAR to getaProp(gObjects, #CHIME)
  6.   if getaProp(PAR, #State) = #nonChaotic then
  7.     if getaProp(ChimeObj, #State) = #nonChaotic then
  8.       set me to getaProp(getaProp(gObjects, getAt(getaProp(getaProp(ChimeObj, #SpecialChild), #nonChaotic), 1)), #animator)
  9.       setPauseState(me, 1)
  10.       set currentFrame to the pCurrentFrame of me
  11.       if (currentFrame = 6) or (currentFrame = 7) then
  12.         playSound(getaProp(ChimeObj, #sound), #cast)
  13.         ChangeSpecialState(OBJref, #Chaotic)
  14.         setAt(getaProp(PAR, #ChildStates), getaProp(ChimeObj, #ChimeNum), 0)
  15.         MakeDynamic(#CHIME, #ChildStates, getaProp(PAR, #ChildStates))
  16.         updateStage()
  17.         if getOne(getaProp(PAR, #ChildStates), 1) < 1 then
  18.           MakeDynamic(#CHIME, #State, #Chaotic)
  19.           eraseRecording(#CHIME)
  20.         end if
  21.         exit
  22.       end if
  23.       ChimePlaySoundNon(OBJref)
  24.       if getaProp(ChimeObj, #State) = #nonChaotic then
  25.         setPauseState(me, 0)
  26.       end if
  27.     else
  28.       ChimePlaySoundNon(OBJref)
  29.     end if
  30.   else
  31.     if getaProp(PAR, #State) = #Chaotic then
  32.       ChimePlaySoundChaotic(OBJref)
  33.     end if
  34.   end if
  35. end
  36.  
  37. on ChimePlaySoundChaotic OBJref
  38.   PlayNoteFromHitMap(#CHIME)
  39. end
  40.  
  41. on ChimePlaySoundNon OBJref
  42.   set OBj to getaProp(gObjects, OBJref)
  43.   PlaytheNote(#CHIME)
  44. end
  45.